﻿using XmlCsvReaderNS;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Xml;
using System.IO;

namespace XmlCsvReaderTest
{
    
    
    /// <summary>
    ///This is a test class for XmlCsvReaderTest and is intended
    ///to contain all XmlCsvReaderTest Unit Tests
    ///</summary>
    [TestClass()]
    public class XmlCsvReaderTest
    {

        [TestMethod]
        public void TestXmlReader()
        {
            XmlDocument doc = new XmlDocument();
            XmlCsvReader reader = new XmlCsvReader(new Uri("file:///C:/temp/input.csv"), doc.NameTable);
            reader.FirstRowHasColumnNames = true;
            reader.RootName = "customers";
            reader.RowName = "customer";

            doc.Load(reader);
            Console.WriteLine(doc.OuterXml);
            doc.Save("output.xml"); 
            
        }
        /*
         * Input.Csv:
"customer_id","account_num","lname","fname","mi"
1,87462024688,"Nowmer","Sheri","A."
2,87470586299,"Whelply","Derrick","I."
         * 
         */
    }
}
